<%--***************************************************************************	
    Created By		: Novan Ananda
    Template        : BBApp_MainScreen
 	Date created 	: 20 Aug 2010 
 	Module 	        : Simas Widget
 	Comments 		: Simas Widget
 --------------------------------------------------------------------------------
 DATE			PROGRAMMER			REMARKS
 --------------------------------------------------------------------------------
 20 Aug 2010	Novan Ananda		Initial Version
 -------------------------------------------------------------------------------- --%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> 
<%@ page import="java.util.*, blackberryAppCom.*"%>
<jsp:useBean id="lObjBBApp_cjbBBApp" class="blackberryApp.BBApp_cjbBBApp" scope= "request"/>

<%	
try { 
		String lStrLocalPath 	= BBApp_Common.fnGetProperty("LOCAL_PATH");
		String lStrLanguage 	= "IN";
		
		String strNoPlat		= BBApp_Common.fnGetValue(lObjBBApp_cjbBBApp.getStrNoPlat());
		String strNoPolis		= BBApp_Common.fnGetValue(lObjBBApp_cjbBBApp.getStrNoPolis());
		String strNama			= BBApp_Common.fnGetValue(lObjBBApp_cjbBBApp.getStrNama());
		String strNoRangka		= BBApp_Common.fnGetValue(lObjBBApp_cjbBBApp.getStrNoRangka());
		String strNoMesin		= BBApp_Common.fnGetValue(lObjBBApp_cjbBBApp.getStrNoMesin());
		
		String strMaxNo			= BBApp_Common.fnGetValue(lObjBBApp_cjbBBApp.getStrMaxNo());
		String strRecNo			= BBApp_Common.fnGetValue(lObjBBApp_cjbBBApp.getStrRecNo());
		
%>

<HTML>
<HEAD>
	<title >Simas Multi Claim Information System</title>
	
	<META HTTPS-EQUIV="Pragma" CONTENT="no-cache">
	<META HTTPS-EQUIV="Expires" CONTENT="-1">
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<link href="<%=lStrLocalPath%>css/novStyles.css" rel="stylesheet">
	<script type="text/javascript" src="<%=lStrLocalPath%>js/BBApp_Common.js"></script>	
	<script type="text/javascript" src="<%=lStrLocalPath%>js/novan_tools.js"></script>
	<script type="text/javascript" src="<%=lStrLocalPath%>js/calendar.js"></script>
	<script type="text/javascript" src="<%=lStrLocalPath%>js/calendar-en.js"></script>
	<script type="text/javascript" src="<%=lStrLocalPath%>js/calendar-setup.js"></script>
	
	<style type="text/css">
		img {
			border-style: none;
		}
		tr {
			font-size: x-small;
		}
		td {
			font-size: x-small;
		}
		.header {
			font-size: x-small;
			font-weight: bold;
			background: #d2b48c;
			color: black;
			text-align: center;
			vertical-align: middle;
		}
		.text {
			font-size: x-small;
			font-weight: normal;
			text-align: left;
			vertical-align: top;
		}
		.number {
			font-size: x-small;
			font-weight: normal;
			text-align: right;
			vertical-align: top;
		}
	</style>
	
	<script type="text/javascript">
		function fnPrevNext(btType) {
			var vMaxNo = '<%= strMaxNo %>';
			var vCurrRecNo = '<%= strRecNo %>';
			var vNewRecNo;
			if (btType == 'prev') {
				vNewRecNo = parseInt(vCurrRecNo) - 1;
				if (vNewRecNo < 1) {
					vNewRecNo = 1;
				}
			} else if (btType == 'next') {
				vNewRecNo = parseInt(vCurrRecNo) + 1;
				if (vNewRecNo > vMaxNo) {
					vNewRecNo = parseInt(vMaxNo);
				}
			}
			document.main_form.hidRecNo.value = vNewRecNo;
			document.main_form.hidMode.value = 1;
	        document.main_form.method = "POST";
	        document.main_form.action = "<%= lStrLocalPath %>BBApp_cMobilScreen";
	        document.getElementById("divStayTopLeft").style.visibility = "visible";
			document.main_form.submit();
		}
	</script>
</HEAD>
<BODY>
	<form name="main_form">
		<input type="hidden" name="hidMode" id="hidMode">
		<input type="hidden" name="hidNoPlat" id="hidNoPlat" value="<%= strNoPlat %>">
		<input type="hidden" name="hidNoPolis" id="hidNoPolis" value="<%= strNoPolis %>">
		<input type="hidden" name="hidNama" id="hidNoPolis" value="<%= strNama %>">
		<input type="hidden" name="hidNoRangka" id="hidNoPolis" value="<%= strNoRangka %>">
		<input type="hidden" name="hidNoMesin" id="hidNoPolis" value="<%= strNoMesin %>">
		
		<input type="hidden" name="hidMaxNo" id="hidMaxNo" value="<%= strMaxNo %>">
		<input type="hidden" name="hidRecNo" id="hidRecNo" value="<%= strRecNo %>">
		<table>
			<tr>
				<td>No Polis</td>
				<td>&nbsp;:&nbsp;</td>
				<td><%= strNoPolis %></td>
			</tr>
			<tr>
				<td>Nama</td>
				<td>&nbsp;:&nbsp;</td>
				<td><%= strNama %></td>
			</tr>
			<tr>
				<td>No Plat</td>
				<td>&nbsp;:&nbsp;</td>
				<td><%= strNoPlat %></td>
			</tr>
			<tr>
				<td>No Rangka</td>
				<td>&nbsp;:&nbsp;</td>
				<td><%= strNoRangka %></td>
			</tr>
			<tr>
				<td>No Mesin</td>
				<td>&nbsp;:&nbsp;</td>
				<td><%= strNoMesin %></td>
			</tr>
			<tr>
				<td colspan="3">
				
		<!-- Menampilkan Histori Klaim -->
		<%
			if (request.getSession().getAttribute("lHstDataClaim") != null) {
				Hashtable lHstDataClaim = (Hashtable) request.getSession().getAttribute("lHstDataClaim");
				int intHstDataClaim = lHstDataClaim.size();
				int intRow = 1;
				for (int a=1; a<=intHstDataClaim; a++) {
					String[] strHstDataClaim = (String[]) lHstDataClaim.get(String.valueOf(a));
					String lObjNoKlaim = strHstDataClaim[0];
					String lObjTglRegister = strHstDataClaim[1];
					String lObjTglLapor = strHstDataClaim[2];
					String lObjNoPlat = strHstDataClaim[3];
					String lObjBengkel = strHstDataClaim[4];
					String lObjKondisi = strHstDataClaim[5];
					String lObjKendala = strHstDataClaim[6];
					String lObjKeterangan = strHstDataClaim[7];
					String lObjStatusKlaim  = strHstDataClaim[8];
					
					int intColorIdx = intRow % 2;
					String strBgColor;
					if (intColorIdx == 0) {
						strBgColor = "style=\"background-color: #f5f5dc;\"";
					} else {
						strBgColor = "style=\"background-color: #f5deb3;\"";
					}
		%>
		<table border="0" width="100%">
			<tr>
				<td colspan="4">
					<font class="text">
						<%= strRecNo %>/<%= strMaxNo %>
						&nbsp;<b>Tgl Lapor:</b>&nbsp;<%= BBApp_Common.fnGetDateDDMMMYYYY(lObjTglLapor) %>
					</font>
				</td>
			</tr>
			<tr class="header">
				<td>Bengkel</td>
				<td>No Klaim</td>
				<td>Tgl Register</td>
				<td>Kondisi</td>
			</tr>
			<tr <%= strBgColor %>>
				<td class="text"><%= lObjBengkel %></td>
				<td class="text"><%= lObjNoKlaim %></td>
				<td class="text"><%= BBApp_Common.fnGetDateDDMMMYYYY(lObjTglRegister) %></td>
				<td class="text"><%= lObjKondisi %></td>
			</tr>	
			<tr <%= strBgColor %>>
				<td colspan="4">
					<table>
						<tr>
							<td class="text">Kendala</td>
							<td class="text">&nbsp;:&nbsp;</td>
							<td class="text"><%= lObjKendala %></td>
						</tr>
						<tr>
							<td class="text">Keterangan</td>
							<td>&nbsp;:&nbsp;</td>
							<td><%= lObjKeterangan %></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
	  			<td class="header" colspan="4">
	  				<%= lObjStatusKlaim %>
	  			</td>
	  		</tr>
		</table>
		<%
					intRow = intRow + 1;
				}
			}
		%>
		<!-- END: BAGIAN UNTUK MENAMPILKAN DATA KLAIM -->
		
			</td>
		</tr>
		
		<tr>
			<td colspan="3" align="left">
				<button type="button" name="btPrev" id="btPrev" onClick="fnPrevNext('prev')">Prev</button>
				&nbsp;
				<button type="button" name="btNext" id="btNext" onClick="fnPrevNext('next')">Next</button>
			</td>
		</tr>
	</table>
	</form>
	
	<script language="JavaScript" src="<%=lStrLocalPath%>js/waterMark0.js"></script>
	<layer id="divStayTopLeft">
		<jsp:include page="/novan_SplashScreen.jsp" />
	</layer>
	<script language="JavaScript" src="<%=lStrLocalPath%>js/waterMark.js"></script>
	
</body>
</html>

<%
}
catch(Exception e) {
	BBApp_Common.fnWriteLog("BBApp_MainScreen","BBApp_MainScreen[JSP]: ","Exception in BBApp_MainScreen: "+ e);
  	request.setAttribute("ErrorCode","2000");
%>
	<jsp:forward page="/UTIL_cERRORPAGE"></jsp:forward>
<%	
}
%>
